import xadmin

# Create your models here.

from food.models import Food, WeeklyFoodMenu, MaterialList, Purchase, FoodMaterial


# 食品列表
class FoodXadmin(object):
    list_display = ['image', 'name', 'category', 'price', 'cost_price', 'market_price', 'stock', 'sales', 'comment',
                    'is_new', 'is_hot', 'is_launched', 'default_image_url']
    model_icon = 'fa fa-crosshairs'


# 每周菜单
class WeeklyFoodMenuXadmin(object):
    list_display = ['date_selection', 'food_category', 'food_li', 'add_time']
    model_icon = 'fa fa-coffee'


# 材料列表
class MaterialListXadmin(object):
    list_display = ['chinese_name', 'english_name', 'category', 'brief', 'nutritive_element', 'nutritive_value']
    model_icon = 'fa fa-cutlery'


# 菜品原材料
class FoodMaterialXadmin(object):
    list_display = ['name', 'material', 'material1', 'material2', 'material3']
    model_icon = 'fa fa-creative-commons'


# 原材料采购表
class PurchaseXadmin(object):
    list_display = ['name', 'image', 'quantity', 'purchase_cost', 'unit_cost', 'add_time']
    model_icon = 'fa fa-map-pin'


xadmin.site.register(Food, FoodXadmin)
xadmin.site.register(WeeklyFoodMenu, WeeklyFoodMenuXadmin)
xadmin.site.register(MaterialList, MaterialListXadmin)
xadmin.site.register(FoodMaterial, FoodMaterialXadmin)
xadmin.site.register(Purchase, PurchaseXadmin)
